import './styles/main.css'
import './styles/index.scss'
import 'primeicons/primeicons.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import PrimeVue from 'primevue/config'
import Nora from '@primevue/themes/nora'
import App from './App.vue'
import router from './router'
import { definePreset } from '@primevue/themes'
import MyTheme from './theme'
import ToastService from 'primevue/toastservice';
import ConfirmationService from 'primevue/confirmationservice';

const app = createApp(App)

app.use(createPinia())
app.use(router)
app.use(ToastService)
app.use(ConfirmationService)

const MyPreset = definePreset(Nora, MyTheme)
app.use(PrimeVue, {
  theme: {
    preset: MyPreset,
  },
})

while (!window.DefaultDt) {
  console.log('-----------------')
  await ((time) => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve(undefined)
      }, time)
    })
  })(500)
}

app.mount('#app')
